<form name="edit_password" class="layui-form layui-form-pane" style="margin:30px 30px 0px 30px;">
	<div class="layui-form-item">
		<label class="layui-form-label">旧密码</label>
		<div class="layui-input-inline">
			<input type="password" class="layui-input" name="password_old" placeholder="请输入6-20位长度的字符"  maxlength="20" />
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">新密码</label>
		<div class="layui-input-inline">
			<input type="password" class="layui-input" name="password_new" maxlength="20" placeholder="请输入6-20位长度的字符" />
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">重复新密码</label>
		<div class="layui-input-inline">
			<input type="password" class="layui-input" name="password_repeat" maxlength="20" placeholder="请再次输入新密码" />
		</div>
	</div>
</form>
<script type="text/javascript">
	
	function edit_password_clickYes(window_open){
		
		var data = disposeFormSerialize('form[name=edit_password]');
		data.action = 'submit';
		
		if(0 === data.password_old.length || 6 > data.password_old.length){
			layer.msg('旧密码长度不正确，请输入6-20位的字符');return;
		};
		if(0 === data.password_new.length || 6 > data.password_new.length){
			layer.msg('新密码长度不正确，请输入6-20位的字符');return;
		};
		if(false === /^[0-9a-zA-z]{6,20}$/.test(data.password_new)){
			layer.msg('新密码格式不正确，请输入大小写字母和数字的组合');return;
		};
		if(0 === data.password_repeat.length){
			layer.msg('请再次输入新密码');return;
		};
		if(data.password_repeat !== data.password_new){
			layer.msg('输入了不一样的新密码，请确认');return;
		};
		if(data.password_old === data.password_new){
			layer.msg('旧密码与新密码相同');return;
		};
		
		action_post_form('{:url("edit_password")}', data, function(response){
			layer.msg(response.message);
			switch(response.errno){
				case 0 :
					setTimeout('window.parent.location.reload()', 2000);
					break;
			};
			
		});
	};
</script>